package org.ivwsqii.decorator.Test;

import org.ivwsqii.decorator.*;

/**
 * 测试
 */
public class Client {

    private String name;
    public Client(String name){
        this.name = name;
    }
    public void buyJianBing(JianBing jianBing){
        System.out.println(name+"购买了 : "+jianBing.description()+" 一份, 花了 : "+jianBing.price()+"块钱~");
        System.out.println();
    }

    public static void main(String[] args) {
        Client client = new Client("ivwsqii");
        client.buyJianBing(new AddEgg(new AddBacon(new AddSausage(new AddVegetable(new NormalJianBing())))));

        Client client1 = new Client("lvdan");
        client1.buyJianBing(new AddBacon(new AddBacon(new AddBacon(new AddBacon(new NormalJianBing())))));

        Client client2 = new Client("dx");
        client2.buyJianBing(new AddSausage(new AddSausage(new AddSausage(new NormalJianBing()))));
    }
}
